import React, {Component} from 'react';
import {StyleSheet, Text, View, Image, ScrollView, Alert} from 'react-native';
import {Button, WhiteSpace, WingBlank, Flex} from '@ant-design/react-native';

export default class Publics extends Component {
    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);

        // 设置当前组件的属性
        this.state = {
            parkinginfo: this.props.parkinginfo,
        };
    }

    render() {
        return (
            // <ScrollView style={{flex: 1}}>
            <WingBlank>
                <Flex style={{width: '100%', height: 150, padding: 10}}>
                    <Flex style={{width: '30%'}}>
                        <Image style={{maxWidth: '100%', maxHeight: '100%'}} source={require('~/assets/confirm/tu2x.png')} />
                    </Flex>
                    <Flex direction="column" align={'start'} style={{width: '70%', marginLeft: 10}}>
                        <Text numberOfLines={1} style={{color: '#333333', fontSize: 15}}>
                            {this.state.parkinginfo.BuildingName}
                            {this.state.parkinginfo.AreaName} {this.state.parkinginfo.ParkingName}
                        </Text>
                        <Flex direction={'row'} style={{marginTop: 8}}>
                            <Text
                                style={{
                                    borderWidth: 1,
                                    color: '#EC4F46',
                                    borderRadius: 5,
                                    borderColor: '#EC4F46',
                                    backgroundColor: '#FDEDEC',
                                    fontSize: 9,
                                }}>
                                {this.state.parkinginfo.ProjectName}
                            </Text>
                            <Text
                                style={{
                                    borderWidth: 1,
                                    color: '#FF811C',
                                    borderRadius: 5,
                                    borderColor: '#FF811C',
                                    backgroundColor: '#FDEDEC',
                                    marginLeft: 9,
                                    fontSize: 9,
                                }}>
                                {this.state.parkinginfo.state}
                            </Text>
                        </Flex>
                        <Text
                            style={{
                                marginTop: 8,
                                color: '#666666',
                                fontSize: 11,
                            }}>
                            地址：{this.state.parkinginfo.Address}
                        </Text>
                        <Flex direction={'row'}>
                            <Text style={{marginTop: 8, fontSize: 11}}>建筑面积：</Text>
                            <Text
                                style={{
                                    marginTop: 8,
                                    color: '#666666',
                                    fontSize: 11,
                                }}>
                                {this.state.parkinginfo.AreaBuilt}平方米
                            </Text>
                        </Flex>
                        <Flex direction={'row'}>
                            <Text style={{marginTop: 8, fontSize: 11}}>使用面积：</Text>
                            <Text
                                style={{
                                    marginTop: 8,
                                    color: '#666666',
                                    fontSize: 11,
                                }}>
                                {this.state.parkinginfo.AreaInner}平方米
                            </Text>
                        </Flex>
                        <Flex direction={'row'}>
                            <Text
                                style={{
                                    marginTop: 8,
                                    color: '#CE2E32',
                                    fontSize: 13,
                                }}>
                                {this.state.PricePromotion > 0 ? '活动价' : '促销价'}：{this.state.parkinginfo.PriceSell}元
                            </Text>
                            <Text
                                style={{
                                    marginLeft: 5,
                                    marginTop: 8,
                                    color: '#999999',
                                    fontSize: 11,
                                }}>
                                原价{this.state.parkinginfo.PriceMarket}元
                            </Text>
                        </Flex>
                        {/* {this.state.show != '' ? (
                            <Flex direction={'column'} align={'start'}>
                                <Text style={{fontSize: 13, marginTop: 8}}>付款方式：{this.state.mode}</Text>
                                <Text style={{fontSize: 13, marginTop: 8}}>套餐{this.state.Package}</Text>
                                <Text style={{fontSize: 13, marginTop: 8}}>10{this.state.number}</Text>
                                <Text style={{fontSize: 13, marginTop: 8}}>返{this.state.number}</Text>
                                <Text style={{fontSize: 13, marginTop: 8}}>得{this.state.number}</Text>
                            </Flex>
                        ) : null} */}
                        {/*<Flex>*/}
                        {/*    <Text style={{fontSize: 13}}>*/}
                        {/*        付款方式：{this.state.mode}*/}
                        {/*    </Text>*/}
                        {/*    <Text style={{fontSize: 13}}>*/}
                        {/*        套餐{this.state.Package}*/}
                        {/*    </Text>*/}
                        {/*</Flex>*/}
                    </Flex>
                </Flex>
                {/*<Flex>*/}
                {/*    <Text>享受权益：</Text>*/}
                {/*</Flex>*/}
                <View
                    style={{
                        width: '100%',
                        height: 2,
                        backgroundColor: '#F6F6F6',
                        marginTop: 12,
                    }}
                />
                <Flex justify={'between'} style={{width: '100%', marginTop: 15}}>
                    <Flex>
                        <Image style={{width: 11.55, height: 11.55}} source={require('~/assets/confirm/tongyi2x.png')} />
                        <Text
                            style={{
                                marginLeft: 3.5,
                                color: '#EC4F46',
                                fontSize: 12.64,
                            }}>
                            0首付
                        </Text>
                    </Flex>
                    <Flex>
                        <Image style={{width: 11.55, height: 11.55}} source={require('~/assets/confirm/tongyi2x.png')} />
                        <Text
                            style={{
                                marginLeft: 3.5,
                                color: '#EC4F46',
                                fontSize: 12.64,
                            }}>
                            拿好礼
                        </Text>
                    </Flex>
                    <Flex>
                        <Image style={{width: 11.55, height: 11.55}} source={require('~/assets/confirm/tongyi2x.png')} />
                        <Text
                            style={{
                                marginLeft: 3.5,
                                color: '#EC4F46',
                                fontSize: 12.64,
                            }}>
                            返现金
                        </Text>
                    </Flex>
                    <Flex>
                        <Image style={{width: 11.55, height: 11.55}} source={require('~/assets/confirm/tongyi2x.png')} />
                        <Text
                            style={{
                                marginLeft: 3.5,
                                color: '#EC4F46',
                                fontSize: 12.64,
                            }}>
                            抽汽车
                        </Text>
                    </Flex>
                    <Flex>
                        <Image style={{width: 11.55, height: 11.55}} source={require('~/assets/confirm/tongyi2x.png')} />
                        <Text
                            style={{
                                marginLeft: 3.5,
                                color: '#EC4F46',
                                fontSize: 12.64,
                            }}>
                            得车位
                        </Text>
                    </Flex>
                </Flex>
            </WingBlank>
        );
    }
}
const styles = StyleSheet.create({
    button: {
        marginBottom: 20,
    },
    button1: {
        marginBottom: 20,
        backgroundColor: '#2574CE',
    },
});
